<template>
  <div class="data-statistics">
    <ContentForm name="原始数据统计总览">
      <div slot="valueform" style="height: calc(100%)">
        <el-table
          v-loading="loading"
          :data="data"
          height="100%"
          border
          stripe>
          <el-table-column label="序号" align="center" type="index" width="80" />
          <el-table-column prop="line" show-overflow-tooltip label="线路" />
          <el-table-column prop="1C" show-overflow-tooltip label="1C">
            <template slot-scope="scope">
              <router-link
                v-if="scope.row['1C']"
                :to="{ path: '/cms/cms/original-data/original-1C', query: { lineCode: scope.row.lineCode,line: scope.row.line}}">
                <el-link :underline="false" style="text-decoration:underline;">{{ scope.row['1C'] }}</el-link>
              </router-link>
              <span v-else>/</span>
            </template>
          </el-table-column>
          <el-table-column prop="2C" show-overflow-tooltip label="2C">
            <template slot-scope="scope">
              <router-link
                v-if="scope.row['2C']"
                :to="{ path: '/cms/cms/original-data/original-2C', query: { lineCode: scope.row.lineCode,line: scope.row.line}}">
                <el-link :underline="false" style="text-decoration:underline;">{{ scope.row['2C'] }}</el-link>
              </router-link>
              <span v-else>/</span>
            </template>
          </el-table-column>
          <el-table-column prop="3C" show-overflow-tooltip label="3C">
            <template slot-scope="scope">
              <span>{{ scope.row['3C']?scope.row['3C']:'/' }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="4C" show-overflow-tooltip label="4C">
            <template slot-scope="scope">
              <router-link
                v-if="scope.row['4C']"
                :to="{ path: '/cms/cms/original-data/original-2C', query: { lineCode: scope.row.lineCode,line: scope.row.line}}">
                <el-link :underline="false" style="text-decoration:underline;">{{ scope.row['4C'] }}</el-link>
              </router-link>
              <span v-else>/</span>
            </template>
          </el-table-column>
          <el-table-column prop="5C" show-overflow-tooltip label="5C">
            <template slot-scope="scope">
              <span>{{ scope.row['5C']?scope.row['5C']:'/' }}</span>
            </template>
          </el-table-column>
          <el-table-column prop="6C" show-overflow-tooltip label="6C">
            <template slot-scope="scope">
              <span>{{ scope.row['6C']?scope.row['6C']:'/' }}</span>
            </template>
          </el-table-column>
        </el-table>
        <!-- <div class="page-box">
          <pagination
            :total="total"
            :page.sync="listQuery.page"
            :size.sync="listQuery.size"
            @pagination="getListPage" />
        </div> -->
      </div>
    </ContentForm>
  </div>
</template>

<script>
import { findOriginalDate } from '@/api/cms/detect-data'
export default {
  name: 'OriginalAll',
  components: {
  },
  data() {
    return {
      loading: false,
      data: [],
      listQuery: {
        page: 1,
        size: 20
      },
      total: 0
    }
  },
  mounted() {
    this.getListPage()
  },
  methods: {
    getListPage() {
      this.loading = true
      findOriginalDate().then(res => {
        this.loading = false
        this.data = res.data
      }).catch(_ => {
        this.loading = false
      })
    }
  }
}
</script>

<style scoped lang="scss">
.page-box{
  bottom:1px;
}
//解决表格缩小后表头错位
  ::v-deep .el-table th.gutter{
      display: table-cell!important;
  }
</style>
